#include <iostream>
#include <cmath>

#ifndef __hhxxttxs_threebody__
#define __hhxxttxs_threebody__

#define L 100 //水平范围0--100
#define H 100 //纵向范围0--100
#define G 6.67e-11 //质量视为均1kg
#define d(a,b) (a>=0&&a<3&&b>=0&&b<3?(sqrt((x_coordinate[a]-x_coordinate[b])*(x_coordinate[a]-x_coordinate[b])+(y_coordinate[a]-y_coordinate[b])*(y_coordinate[a]-y_coordinate[b]))):-1)
#define Fx(a,b) (G*(x_coordinate[a]-x_coordinate[b])/d(a,b)/d(a,b)/d(a,b)) //等于加速度
#define Fy(a,b) (G*(y_coordinate[a]-y_coordinate[b])/d(a,b)/d(a,b)/d(a,b)) //等于加速度

class ThreeBody
{
    private:
    double x_coordinate[3];
    double y_coordinate[3];
    double v_x[3];
    double v_y[3];
    public:
    ThreeBody();
    ~ThreeBody();
    void set_x (double *_k);
    void set_y (double *_k);
    void get_x (unsigned long _t);
    void get_y (unsigned long _t);
};

ThreeBody::ThreeBody()
{
    for(int i=0;i<3;i++){
        x_coordinate[i]=y_coordinate[i]=-1;
        v_x[i]=v_y[i]=0;
    }
};

ThreeBody::~ThreeBody()
{
    delete x_coordinate;
    delete y_coordinate;
    delete v_x;
    delete v_y;
}

void ThreeBody::set_x(double *_k)
{
    for(int i = 0; i < 3; i++)
        x_coordinate[i]=_k[i];
};

void ThreeBody::set_y(double *_k)
{
    for(int i = 0; i < 3; i++)
        y_coordinate[i]=_k[i];
};

void ThreeBody::get_x (unsigned long _t)
{
    for (unsigned long i = 0; i < _t; i++){

        for(int j=0;j<3;j++)
        x_coordinate[j]=
    }
};

#else
//do nothing
#endif